package com.njbw.design_pattern.struct.bridge2;

import com.njbw.design_pattern.struct.bridge2.abstractor.*;
import com.njbw.design_pattern.struct.bridge2.implementor.EmailSender;
import com.njbw.design_pattern.struct.bridge2.implementor.InstantMessageSender;
import com.njbw.design_pattern.struct.bridge2.implementor.SmsSender;

/**
 * 后续优化，不同紧急程度的通知放到不同的队列中，由队列决定优先级进行消费
 * 多个维度需要不同变化的场景，让这些变化相互独立
 */
public class Main {

    public static void main(String[] args) {
        MessageSender emailSender = new EmailSender();
        MessageSender smsSender = new SmsSender();
        MessageSender instantMessageSender = new InstantMessageSender();

        Notification normalNotification = new NormalNotification(emailSender);
        normalNotification.notify("第一个任务待处理");

        Notification urgentNotification = new UrgentNotification(smsSender);
        urgentNotification.notify("第二个任务待处理");

        Notification criticalNotification = new CriticalNotification(instantMessageSender);
        criticalNotification.notify("第三个任务待处理");
    }
}
